home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / NetSprocketTest / App.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.9 KB  |  181 lines  |  [TEXT/CWIE]

  1. /***********************************************************************
  2. #
  3. #        App.h
  4. #
  5. #        This file contains the constants and structure definitions.
  6. #
  7. #        Author: Michael Marinkovich
  8. #                Apple Developer Technical Support
  9. #
  10. #
  11. #        Modification History: 
  12. #
  13. #            6/4/95        MWM     Initial coding                     
  14. #            10/12/95    MWM        cleaned up
  15. #
  16. #        Copyright © 1992-95 Apple Computer, Inc., All Rights Reserved
  17. #
  18. #
  19. ***********************************************************************/
  20. #pragma once
  21.  
  22. #include <Controls.h>
  23. #include <QDOffscreen.h>
  24.  
  25.  
  26. //---------------------------------------------------------------------
  27. //
  28. //    Macros
  29. //
  30. //---------------------------------------------------------------------
  31.  
  32. #define MIN(x,y)            ( ((x)<(y)) ? (x) : (y) )
  33. #define MAX(x,y)            ( ((x)>(y)) ? (x) : (y) )
  34. #define TopLeft( r )        ( *(Point *) &(r).top )
  35. #define BotRight( r )        ( *(Point *) &(r).bottom )
  36.  
  37.  
  38. //---------------------------------------------------------------------
  39. //
  40. //    General
  41. //
  42. //---------------------------------------------------------------------
  43.  
  44. #define kMinHeap            300 * 1024
  45. #define kMinSpace            300 * 1024
  46.  
  47.  
  48. //---------------------------------------------------------------------
  49. //
  50. //    Menus
  51. //
  52. //---------------------------------------------------------------------
  53.  
  54. #define rMBarID                128
  55.  
  56. enum {
  57.      mApple                    = 128,
  58.     iAbout                    = 1,
  59.  
  60.     mFile                    = 129,
  61.     iHost                    = 1,
  62.     iJoin                    = 2,
  63.     iLeave                    = 3,
  64.     iQuit                    = 5
  65. };
  66.  
  67.  
  68. //---------------------------------------------------------------------
  69. //
  70. //    Window stuff
  71. //
  72. //---------------------------------------------------------------------
  73.  
  74. // doc types
  75. enum {
  76.     kDocKind                = 94,
  77.     kDialogKind                = 95,
  78.     kFloatKind                = 96,
  79.     kAboutKind                = 97
  80. };    
  81.  
  82. #define kFudgeFactor        4        // fudge factor for boundary around window
  83. #define kTitleBarHeight        18        // title bar height
  84.  
  85. // scroll values
  86. #define kScrollWidth        15
  87. #define kScrollDelta        16
  88.  
  89.  
  90. //---------------------------------------------------------------------
  91. //
  92. //    General resource ID's
  93. //
  94. //---------------------------------------------------------------------
  95.  
  96. #define rAboutPictID        3000 // about picture
  97. #define rErrorDlg            128     // main error dialog
  98.  
  99.  
  100. //---------------------------------------------------------------------
  101. //
  102. //    Alert Error ID's
  103. //
  104. //---------------------------------------------------------------------
  105.  
  106. #define kNeedsDisplayManager        128    // ID of no Display Manager
  107.  
  108.  
  109. //---------------------------------------------------------------------
  110. //
  111. //    Custom Event Proc stuff
  112. //
  113. //---------------------------------------------------------------------
  114.  
  115. enum {
  116.     kIdleProc            = 1,
  117.     kMenuProc,
  118.     kInContentProc,
  119.     kInGoAwayProc,
  120.     kInZoomProc,
  121.     kInGrowProc,
  122.     kMUpProc,
  123.     kKeyProc,
  124.     kActivateProc,
  125.     kUpdateProc
  126. };
  127.     
  128.  
  129. //---------------------------------------------------------------------
  130. //
  131. //    Typedefs
  132. //
  133. //---------------------------------------------------------------------
  134.  
  135. // event handling proc
  136. typedef void (*CustomProc)(WindowRef window, void *refCon);
  137.  
  138.  
  139. // we just use the basic events for the callback procs
  140.  
  141. struct DocRec
  142. {    
  143.     CustomProc                    idleProc;            // custom idle proc
  144.     CustomProc                    mMenuProc;            // custom menu proc
  145.     CustomProc                    inContentProc;        // custom content click Proc
  146.     CustomProc                    inGoAwayProc;        // custom inGoAway proc
  147.     CustomProc                    inZoomProc;            // custom inZoom proc
  148.     CustomProc                    inGrowProc;            // custom inGrow proc
  149.     CustomProc                    mUpProc;            // custom mouseUp proc
  150.     CustomProc                    keyProc;            // custom autoKey-keyDown proc
  151.     CustomProc                    activateProc;        // custom activate window proc
  152.     CustomProc                    updateProc;            // custom window update proc
  153.     ControlHandle                hScroll;            // horz scroll bar
  154.     ControlHandle                vScroll;            // vert scroll bar
  155.     GWorldPtr                    world;                // offscreen for pict imaging
  156.     PicHandle                    pict;                // windows picture
  157. //    THPrint                        printer;            // apps print record - inited at window int
  158.     Boolean                        dirty;                // document needs saving
  159. };
  160.  
  161. typedef struct DocRec DocRec;
  162. typedef DocRec *DocPtr, **DocHnd;
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.